<template>
	<div class="manage_page" style="height: 100%;">
		<el-row style="height: 100%;" >
	  		<el-col :span="pcflag1" style="min-height: 100%; background-color: 	#4169E1	;" >
				<el-menu   unique-opened :default-openeds="default_openeds_choice"  :default-active="defaultActive" style="min-height: 100%;"  background-color="	#4169E1	"  text-color="#fff"
					 active-text-color="#00FFFF"   theme="light" router  >
					 <!-- unique-opened --> 
					<el-menu-item index="menu"><i class="el-icon-menu" style="color: #00FFFF;"></i>首页</el-menu-item>
					 <!-- v-show="$store.state.adminInfo.permission=='master'" -->
				
				    <el-submenu index="3" v-if="choice_web!='model'">
						<template slot="title"><i class="el-icon-s-operation" style="color: #00FFFF;"></i>申赎运维</template>
						
						<el-menu-item index="tradesys_moneychange">出入金统计</el-menu-item>
						<el-menu-item index="tradesys_purchase">申购赎回账户</el-menu-item>
						<el-menu-item index="tradesys_purchase_summary">申购赎回产品</el-menu-item>
						<!-- <el-menu-item index="tradesys_buy">申购赎回</el-menu-item> -->
						<el-menu-item index="purchase_log">申购结果</el-menu-item>
						<el-menu-item index="product_futures_operation">期货操作</el-menu-item>
						<el-menu-item index="product_sell_table">卖出操作</el-menu-item>
						<el-menu-item index="tradesys_jobs">交易机操作</el-menu-item>
					</el-submenu>
					
					<el-submenu index="3" v-if="choice_web!='model'">
						<template slot="title"><i class="el-icon-s-operation" style="color: #00FFFF;"></i>产品维护</template>
						<el-menu-item index="tradesys_log">交易日志</el-menu-item>
						<el-menu-item index="account_dict">账户列表</el-menu-item>
						<el-menu-item index="product_dict">产品列表</el-menu-item>
						<el-menu-item index="product_dict_summary">券商汇总</el-menu-item>
						<el-menu-item index="account_report">账户报表</el-menu-item>
						<el-menu-item index="performance_dict">业绩拆分</el-menu-item>
						
					</el-submenu>		
					<el-submenu index="3" v-if="choice_web!='model'">
						<template slot="title"><i class="el-icon-s-operation" style="color: #00FFFF;"></i>系统运维</template>
						<el-menu-item index="config_qs_key">config_qs_key</el-menu-item>
						<el-menu-item index="config_account">CONFIG修改</el-menu-item>
						<el-menu-item index="config_event">WORKFLOW修改</el-menu-item>
						<el-menu-item index="api_Interface">其他接口</el-menu-item>
						
						
					</el-submenu>			
				
				</el-menu>
			</el-col>
			<el-col :span="pcflag2" style="height: 100%;overflow: auto;">
				<keep-alive>
				    <router-view></router-view>
				</keep-alive>
			</el-col>
		</el-row>
  	</div>
</template>

<script>
    export default {
		data(){
			return {
				// web_choice:true,
				default_openeds_choice:["2","5"],
				pcflag: true,
				pcflag1:3,
				pcflag2:21,
			}
		},
		computed: {
			defaultActive: function(){
				return this.$route.path.replace('/', '');
			}
		},
		
		
		created() {
			this.browserRedirect() ;
			console.log("当前登入用户", this.$store.state.adminInfo.name);
			console.log("当前登入页面",this.$route.path, );
			if (this.$route.path=='/'){
				this.$router.push({
					path: `/menu`
				})
				
			}
			
			
			
			// if (this.$store.state.adminInfo.name == "none") {
			// 	console.log("未登入")
			// 	this.$router.push({
			// 		path: `/`
			// 	})
			// }
		},
		
		mounted() {
		    // 1. 获取对应的 dom 节点
		    // choice_web = window.choice_web
		  	// console.log('choice_web',choice_web,'!!!!!!!!!!!!!!!!!')
		},
		
		methods: {
					
				  browserRedirect() {
				            var sUserAgent = navigator.userAgent.toLowerCase();
				            var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
				            var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
				            var bIsMidp = sUserAgent.match(/midp/i) == "midp";
				            var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
				            var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
				            var bIsAndroid = sUserAgent.match(/android/i) == "android";
				            var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
				            var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
				            if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
				               
							   this.pcflag1=0;
							    this.pcflag2=24;
				            } else {
				            
				            this.pcflag1=3;
				             this.pcflag2=21;
				            }
				        }
		
		},
    }
</script>


<style  scoped>
	.manage_page{
		
	}
</style>
